import java.awt.Point;
import java.util.ArrayList;


public class EnemyTeam {
	private ArrayList<Character> team;
	private String name;

	public EnemyTeam(){
		name = "Enemy Team";
		team = new ArrayList<Character>();
	}

	public ArrayList<Character> getTeam(){
		return team;
	}
	
	public void add(Character x){
		x.setTeam(name);
		team.add(x);
	}
	
	public String getName(){
		return name;
	}
	
	public void remove(Character x){
		team.remove(x);
	}
	
	public Character isClicked(Character selectedChar, Tile[][] tilegrid){
		Character clickedChar = null;
		for(Character i : team){
			if(i.selected(tilegrid) != null && !i.equals(selectedChar))
        		clickedChar = i;
				i.unSelected();
		}

		return clickedChar;	
	}
	
	public ArrayList<Point> getLocations(){
		ArrayList<Point> locs = new ArrayList<Point>();
		for(Character i : team){
			locs.add(i.getPosition());
		}
		return locs;
	}

	public String toString(){
		String output = "Team: " + name;
		for(Character i: team){
			output += "\n   " + i.getName();
		}
		
		return output;
	}
	
	
	
	/*public void act(PlayerTeam x, String[] map){
		System.out.println("Act");
		for(Character i : team){
			System.out.println(i.getName());
			ArrayList<Character> targets = i.getTargets(x, this);
			System.out.println(targets);
			if(targets.size()!=0){
				i.AIattack(targets, x, this, map);
			}
		}
	} */
	
	

}
